#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Datetime: 2021/10/30 15:09
# @Author  : CHEN Wang
# @Site    :
# @File    : weekly_get_exchange_trading_volume.py
# @Software: PyCharm

"""
脚本说明: get_exchange_trading_volume 每周更新
"""

from TQR_Applications.factor_database.crypto.trading_data_update import get_exchange_trading_volume
from logger import logger
import os
import traceback
from task_monitor import task_to_db, send_error_to_email

if __name__ == '__main__':
    # 获取中心化交易所交易量，去中心化交易所交易量
    logger.info("开始get_exchange_trading_volume")
    task_to_db(os.path.basename(__file__), 'get_exchange_trading_volume')
    try:
        get_exchange_trading_volume()
    except Exception as e:
        msg = traceback.format_exc()
        logger.info(msg)
        send_error_to_email(script_name=os.path.basename(__file__), func_name="get_exchange_trading_volume", message=msg)
        raise e
    task_to_db(os.path.basename(__file__), 'get_exchange_trading_volume', 1)
    logger.info("成功get_exchange_trading_volume")